package calao.contact.client;

import calao.client.MissingPermissionException;
import calao.client.NotConnectedException;
import calao.client.Permission;

import com.google.gwt.user.client.rpc.RemoteService;

public interface ContactService
extends RemoteService
{
	
	public final static Permission MODIFY_CONTACTS = new Permission("calao.contact.Modify");

	/** Lists contacts.
	 */
	Contact[] listContacts(int group, int org, int detailLevel)
	throws NotConnectedException, MissingPermissionException;

	/** Gets details of a contact.
	 */
	Contact getContactDetails(int cid)
	throws NotConnectedException, MissingPermissionException;

	/** Lists all groups.
	 */
	Group[] listGroups()
	throws NotConnectedException, MissingPermissionException;
	
	/** Creates a contact.
	 */
	Contact createContact(Contact details)
	throws NotConnectedException, MissingPermissionException;
	
	/** Saves contact changes.
	 */
	void save(Contact contact)
	throws NotConnectedException, MissingPermissionException;
	
	/** Creates group.
	 */
	Group createGroup(Group details)
	throws NotConnectedException, MissingPermissionException;
	
	/** Saves group changes.
	 */
	void save(Group group)
	throws NotConnectedException, MissingPermissionException;

}
